package evs.testbrp;

import java.util.Date;
import java.util.Vector;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import evs.brp.RemotingErrorException;
import evs.brp.Requestor;

public class GeneratedClientProxy 
		extends Requestor 
		implements GeneratedInterfaceDescription {
	
	private Log log = LogFactory.getLog(GeneratedClientProxy.class);

	public String echo(String message) {
		log.info("Invoking Requestor Method");
		
		Vector<Class>  argumentClazzes = new Vector<Class>();
		argumentClazzes.add(String.class);

		Vector<String> argumentNames = new Vector<String>();
		argumentNames.add("message");
		
		Vector<Object> arguments = new Vector<Object>();
		arguments.add(message);
		
		try {
			Object object = this.invoke("evs.testbrp.RemoteObject", "echo", 
					argumentClazzes, argumentNames, arguments, 
					String.class);
			
			return (String)object;
		} catch (RemotingErrorException exc) {
			log.error(exc);
			return null;
		}
	}
	

	public Double add(Integer i, Long l) {
		log.info("Invoking Requestor Method");
		
		Vector<Class>  argumentClazzes = new Vector<Class>();
		argumentClazzes.add(Integer.class);
		argumentClazzes.add(Long.class);

		Vector<String> argumentNames = new Vector<String>();
		argumentNames.add("intParam");
		argumentNames.add("longParam");
		
		Vector<Object> arguments = new Vector<Object>();
		arguments.add(i);
		arguments.add(l);
		
		try {
			Object object = this.invoke("evs.testbrp.RemoteObject", "add", 
					argumentClazzes, argumentNames, arguments, 
					Double.class);
			
			return (Double)object;
		} catch (RemotingErrorException exc) {
			log.error(exc);
			return null;
		}
	}

	public Date getServerTime() {
		log.info("Invoking Requestor Method");
		
		Vector<Class>  argumentClazzes = new Vector<Class>();

		Vector<String> argumentNames = new Vector<String>();
		
		Vector<Object> arguments = new Vector<Object>();
		
		try {
			Object object = this.invoke("evs.testbrp.RemoteObject", "getServerTime", 
					argumentClazzes, argumentNames, arguments, 
					Date.class);
			
			return (Date)object;
		} catch (RemotingErrorException exc) {
			log.error(exc);
			return null;
		}
	}

}
